//
//  CourseDetailModel.m
//  Arts1
//
//  Created by 孤星晨宇 on 15/9/29.
//  Copyright © 2015年 Arts1. All rights reserved.
//

#import "CourseDetailModel.h"

@implementation CourseDetailModel

- (void)setValue:(id)value forUndefinedKey:(NSString *)key{

    if ([key isEqualToString:@"courselist"]) {
        self.courseArr = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            CourseModel *course = [[CourseModel alloc] init];
            [course setValuesForKeysWithDictionary:dic];
            [_courseArr addObject:course];
        }
    }
    if ([key isEqualToString:@"photolist"]) {
        self.photoArr = [NSMutableArray array];
            for (NSDictionary *dic in value) {
                NSString *str = [dic objectForKey:@"photoName"];
                [_photoArr addObject:str];
            }
    }
    
}

- (void)setValue:(id)value forKey:(NSString *)key{
     [super setValue:value forKey:key];
    if ([key isEqualToString:@"teacher"]) {
        _teacher = [[TeacherModel alloc] init];
        [_teacher setValuesForKeysWithDictionary:value];
    }
}


@end
